package com.googlecode.mgwt.examples.showcase.client.activities;

import java.util.ArrayList;
import java.util.List;

import com.googlecode.mgwt.examples.showcase.client.ClientFactory;
import com.googlecode.mgwt.examples.showcase.client.activities.animation.ServiceRequesPlace;
import com.googlecode.mgwt.examples.showcase.client.activities.home.Topic;
import com.googlecode.mgwt.examples.showcase.client.places.TecPlace;
import com.googlecode.mgwt.examples.showcase.client.places.WaterCountPlace;
import com.googlecode.mgwt.ui.client.widget.celllist.CellSelectedEvent;


public class IrisShowCaseListActivity extends ShowCaseListActivity {

	public IrisShowCaseListActivity(ClientFactory clientFactory) {
		super(clientFactory);
	}
	
	@Override
	public void cellSelected(CellSelectedEvent event) {
		int index = event.getIndex();

		if (index == 0) {
			clientFactory.getPlaceController().goTo(new ServiceRequesPlace());
			return;
		}
		if (index == 1) {
			clientFactory.getPlaceController().goTo(new TecPlace());

			return;
		}
		if (index == 2) {
			clientFactory.getPlaceController().goTo(new WaterCountPlace());
			
			return;
		}
		if (index == 3) {
			clientFactory.getPlaceController().goTo(new TecPlace());
			
			return;
		}
	}
	
	
	@Override
	protected List<Topic> createTopicsList() {
		ArrayList<Topic> list = new ArrayList<Topic>();
		list.add(new Topic(clientFactory.getUserProfile().getCurrentUser().getLabels().reportButton(), 5));
		list.add(new Topic(clientFactory.getUserProfile().getCurrentUser().getLabels().tecButton(), 5));
//		list.add(new Topic(clientFactory.getUserProfile().getCurrentUser().getLabels().waterCount(), 5));
//		list.add(new Topic(clientFactory.getUserProfile().getCurrentUser().getLabels().admin(), 5));

		return list;
	}
	
	

}
